package com.jpa.demo.reflection;

import com.jpa.demo.annotationdemo.MyAnnotation;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Arrays;

public class ReflectionTest {

    public static void main(String[] args) {
//        Field[] declaredFields = ReflectionClass.class.getDeclaredFields();
//        Arrays.stream(declaredFields).forEach(data ->{
//            System.out.println(data.isAnnotationPresent(MyAnnotation.class));
//        });

//        Method[] declaredMethods = ReflectionClass.class.getDeclaredMethods();
//        Arrays.stream(declaredMethods).forEach(System.out::println);
        //java在泛型的子类的类型擦除的时候会生成一个桥接类用以转换参数类型
        Arrays.stream(Child.class.getDeclaredMethods()).forEach(data -> System.out.println(data.getName()+"---------------------"+data.isBridge()));
    }
}
